package real.lang.reflect;

import real.lang.RealLangException;

public abstract class AbstractRealType implements RealType {
	
	private Class<?> javaClass = null;
	
	public Class<?> getJavaClass() {
		return javaClass;
	}
	
	protected void setJavaClass(Class<?> javaclass) {
		this.javaClass = javaclass;
	} 
	
	private Class<?> realClass = null;

	public Class<?> getRealClass() {
		return realClass;
	}
	
	protected void setRealClass(Class<?> realclass) {
		this.realClass = realclass;
	} 
	
	@Override
	public String toString() {		
		return this.getName();
	}
	
	public boolean IsRealSubtype() throws RealLangException {
		return (HasSuperType());
	}
	
	@Override
	public boolean equals(Object obj) {
		if (obj instanceof RealType)
			return this.equals((RealType)obj);
		return super.equals(obj);
	}
	
	public boolean equals(RealType type) {		
		return this.getSignature().equals(type.getSignature());
	}
	
	AbstractRealType(Class<?> real) {
		this.realClass = real;			
	}
	
	AbstractRealType(Class<?> real, Class<?> java) {
		this.realClass = real;
		this.javaClass = java;	
	}
	
}
